import { createRouter, createWebHashHistory, RouteRecordRaw } from "vue-router";
import Home from "@/views/Home.vue";

const routes: Array<RouteRecordRaw> = [
  {
    path: "/login",
    name: "Login",
    component: () => import("@/views/Login.vue"),
  },
  {
    path: "/",
    name: "Home",
    component: Home,
    // children: [
    //   {
    //     path: "",
    //     component: () => import("../containers/Dashboard.vue"),
    //   },
    //   {
    //     path: "list",
    //     component: () => import("../containers/List.vue"),
    //   },
    //   {
    //     path: "message",
    //     component: () => import("../containers/Message.vue"),
    //   },
    //   {
    //     path: "setting",
    //     component: () => import("../containers/Setting.vue"),
    //   },
    //   {
    //     path: "user",
    //     component: () => import("../containers/User.vue"),
    //   },
    //   {
    //     path: "password",
    //     component: () => import("../containers/Password.vue"),
    //   },
    //   // {
    //   //   path: "/:pathMatch(.*)*",
    //   //   component: () => import("../containers/NotFound.vue"),
    //   // },
    // ],
  },
  //   {
  //     path: "/:pathMatch(.*)*",
  //     name: "NotFound",
  //     component: () => import("../containers/NotFound.vue"),
  //   },
];

const router = createRouter({
  history: createWebHashHistory(),
  routes,
});

router.beforeEach(async (to, from) => {
  // console.log(to, from);
});

export default router;
